fix(gcs): use snake_case field names in notification request and response#82
Open
nicoechegut wants to merge 2 commits into
Open
fix(gcs): use snake_case field names in notification request and response#82nicoechegut wants to merge 2 commits into
nicoechegut wants to merge 2 commits into
Conversation
nicoechegut
marked this pull request as ready for review
July 2, 2026 17:16
Contributor
|
Thanks for the fix! Verified against the JSON API spec. Two small asks: 1. Add round-trip assertions to assertThat(notification.getPayloadFormat()).isEqualTo(NotificationInfo.PayloadFormat.JSON_API_V1);
assertThat(notification.getEventTypes())
.containsExactlyInAnyOrder(NotificationInfo.EventType.OBJECT_FINALIZE,
NotificationInfo.EventType.OBJECT_DELETE);2. Add @JsonProperty("payload_format")
@JsonAlias("payloadFormat")
private String payloadFormat = "JSON_API_V1";Otherwise LGTM |
nicoechegut
force-pushed
the
fix-create-notification-fields
branch
from
July 15, 2026 10:31
4448771 to
dcbe741
Compare
nicoechegut
force-pushed
the
fix-create-notification-fields
branch
from
July 15, 2026 10:32
dcbe741 to
51b4200
Compare
Author
|
Thanks for the review @hectorvent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Google Storage REST API uses snake_case for notification fields (
payload_format,event_types,object_name_prefix,custom_attributes), butcreateNotificationwas reading camelCase keys from the request body, silently dropping those values. The GET response also serialized as camelCase, so clients reading back a notification would receive empty values for those fields.Fix
GcsServiceto accept snake_case keys and add@JsonPropertyannotations toStoredNotificationso the response matches the API spec: https://docs.cloud.google.com/storage/docs/json_api/v1/notificationsType of change
fix:)feat:)feat!:orfix!:)GCP Compatibility
Verified by creating a GCS Notification via a Terraform test and the
hashicorp/googleTerraform provider.Before the fix, Terraform fails to apply with error, indicating the API returns empty fields:
Ran the sdk-test-java compatibility tests which include
GcsNotificationTest.Checklist
./mvnw testpasses locally